Transport model as a variational inequality
emp
JAMS
GAMS
short
%MODELSTAT.OPTIMAL%] 'LP not solved';
*-------------------------------------------------------------------------------
* That's how the VI looks like
positive variable
dPrice(j) 'demand price';
negative variable
sPrice(i) 'supply price*(-1)';
equations
ggrad(i,j) 'MCP version of grad from VI';
ggrad(i,j).. c(i,j) - sPrice(i) - dPrice(j) =N= 0;
model mcpTransport / ggrad.x, supply.sPrice, demand.dPrice /;
$ontext
*Adopt solution from LP solve and verify it is a solution of the MCP
sPrice.l(i) = supply.m(i);
dPrice.l(j) = demand.m(j);
mcpTransport.iterlim = 0;
solve mcpTransport using mcp;
abort$[mcpTransport.objVal > 1e-6] 'Input for model mcpTransport should be optimal, was not';
$offtext
*-------------------------------------------------------------------------------
* Now use EMP to this reformulation
* F(x) = c for our VI: LP models yield a linear VI
equations
grad(i,j) 'dcost/dx(i,j)';
grad(i,j).. c(i,j) =N= 0;
model viTransport / grad, supply, demand /;
file myinfo / '%emp.info%' /;
put myinfo '* complementarity pairs for grad.x' /;
putclose 'vi grad x';
$onecho > jams.opt
subsolveropt 1
$offecho
$onecho > path.opt
crash_method none;
crash_perturb no;
lemke_start first;
$offecho
viTransport.optfile = 1;
solve viTransport using emp;
abort$[viTransport.objVal > 1e-6] 'Input for model viTransport should be optimal, was not';
]]>
Example showing how to write a VI as an MCP
We want to write the VI using EMP to avoid manual translation to MCP. We use
the definitions of VI and MCP from
Steven P. Dirkse, Ph.D. Dissertation
Robust Solution of Mixed Complementarity Problems.
Mathematical Programming Technical Report 94-12, August 1994.
ftp://ftp.cs.wisc.edu/math-prog/tech-reports/94-12.ps
Pages 4-6
In this case, the VI to start with is what we get by letting F(x) = df/dx,
where f is the objective in the transport model.
We adjusted the data to get nonzero supply marginals.
Contributor: Steven Dirkse and Jan-H. Jagla, January 2009